package com.chb.template;

/**
 * @author chihb
 * @create-time 2024/10/24 16:23
 * @description
 */
public abstract class AbstractClass {
    public final void templateMethod(){
        //第一步：倒油
        this.pourOil();
        //第二步：热油
        this.heatOil();
        //第三步：倒蔬菜
        this.pourVegetable();
        //第四步：倒调味料
        this.pourSauce();
        //第五步：翻炒
        this.fry();
    }
    private void pourOil(){
        System.out.println("倒油");
    }
    private void heatOil(){
        System.out.println("热油");
    }
    protected abstract void pourVegetable();
    protected abstract void pourSauce();
    private void fry(){
        System.out.println("翻炒");
    }
}
